using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Mark.Models;

/// <summary>
/// AI模型实体
/// </summary>
public class Model : BaseEntity
{
    [Required]
    [MaxLength(100)]
    public string Name { get; set; } = string.Empty;
    
    [MaxLength(200)]
    public string? DisplayName { get; set; }
    
    [MaxLength(500)]
    public string? Description { get; set; }
    
    /// <summary>
    /// 模型类型：Chat, Completion, Embedding, etc.
    /// </summary>
    [Required]
    [MaxLength(50)]
    public string Type { get; set; } = "Chat";
    
    /// <summary>
    /// 模型版本
    /// </summary>
    [MaxLength(50)]
    public string? Version { get; set; }
    
    /// <summary>
    /// 上下文长度
    /// </summary>
    public int ContextLength { get; set; } = 4096;
    
    /// <summary>
    /// 输入价格（每1K tokens）
    /// </summary>
    public decimal InputPrice { get; set; } = 0;
    
    /// <summary>
    /// 输出价格（每1K tokens）
    /// </summary>
    public decimal OutputPrice { get; set; } = 0;
    
    /// <summary>
    /// 模型配置 (JSON)
    /// </summary>
    public string? Config { get; set; }
    
    /// <summary>
    /// 模型状态：Active, Inactive, Deprecated
    /// </summary>
    [MaxLength(20)]
    public string Status { get; set; } = "Active";
    
    /// <summary>
    /// 支持的功能：Vision, Function, etc.
    /// </summary>
    [MaxLength(500)]
    public string? SupportedFeatures { get; set; }
    
    /// <summary>
    /// 排序优先级
    /// </summary>
    public int Priority { get; set; } = 0;
    
    // 外键
    [Required]
    public string ProviderId { get; set; } = string.Empty;
    
    // 导航属性
    [ForeignKey("ProviderId")]
    public virtual Provider Provider { get; set; } = null!;
    
    public virtual ICollection<Message> Messages { get; set; } = new List<Message>();
} 